﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BinaryTree
{
    /// <summary>
    /// 生成一个树
    /// </summary>
    class CreatTree
    {
        public class Tree
        {
            public string Value;
            public Tree Left;
            public Tree Right;
        }

        public static Tree CreatFakeTree()
        {
            Tree tree = new Tree() { Value = "A" };
            tree.Left = new Tree()
            {
                Value = "B",
                Left = new Tree() { Value = "D", Left = new Tree() { Value = "G" } },
                Right = new Tree() { Value ="E",Right = new Tree() { Value = "H"} }
            };
            tree.Right = new Tree() { Value = "C", Right = new Tree() { Value = "F" } };
            return tree;
        }

        /*  树结构：                         A
         *                                  / \
         *                                 B   C
         *                                / \   \
         *                               D   E   F
         *                              /     \
         *                             G       H
         */
    }
}
